package designPattern.builder;

class Director {

    private MailBuilder mailBuilder = null;

    Director(MailBuilder mailBuilder){
        this.mailBuilder = mailBuilder;
    }

    //构建对象
    void construct(String from, String to, String subject, String content) {
        mailBuilder
                .buildMail()
                .buildFrom("6666@qq.com")
                .buildTo("7777@qq.com")
                .buildSubject("Builder")
                .buildContent("finish building")
                .toMail();
    }
}
